<template>
    <div v-load="loding">
        <div v-for="item in details" class="decse">
            <span class="title">{{item.label}}</span>
            <template v-if="Array.isArray(item.value)">
                <span v-for="agr in item.value"><a :href="agr.filePath">《{{ agr.fileName }}》</a></span>
            </template>
            <span v-else>{{ item.value }}</span>
        </div>
    </div>
</template>
<script setup>
import {getOrderauthorizationInfo} from "@/server/manage/incoming.js"
import { platform } from "@/utils/enum.js"

import { ref } from "vue";
const prop = defineProps(["rowInfo"])
const details = ref([])
const loding = ref(true)
// 获取详情
const getInfo = () => {
    getOrderauthorizationInfo(prop.rowInfo.authorizationId, {authorizationId: prop.rowInfo.authorizationId}).then(res => {
        loding.value = false
        console.log(res.OrderAuthorizationInfoDetailPojo);
        let order = res.OrderAuthorizationInfoDetailPojo
        details.value = [
            {label: '订单编号', value: order.orderCode},
            {label: '客户统一社会信用代码', value: order.idNo},
            {label: '客户企业名称', value: order.custName},
            {label: '客户企业省市', value: order.eprovinceCity},
            {label: '所属电商平台', value: (platform||[]).filter(item => item.value == order.ebusinessPlatform)[0]?.label||'--'},
            {label: '开店日期', value: order.eplatformStartDate},
            {label: '产品邀请码', value: order.productNum},
            {label: '渠道名称', value: order.channelName},
            {label: '产品名称', value: order.productName},
            {label: '授权时间', value: order.createTime},
            {label: '授权文件', value: order.agreementList},
        ]
    })
}
getInfo()
</script>
<style scoped>
.decse{
    display: flex;
    margin-bottom: 10px;
}
.title{
    width: 200px;
    font-weight: 600;
    text-align: right;
    padding-right: 10px;
}
</style>